package com.tony.pmp.model.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *
 * @Title: SysProductClassifyEntity
 * @Auther: 皮蛋布丁
 * @Date: 2021/08/06/13:29
 * @Description: 商品分类表
 */
@Data
@TableName("sys_product_classify")
public class SysProductClassifyEntity implements Serializable {

    private static final Long serialVersionUID = 1L;

    @TableId
    public int id;

    //分类： 0-大类  1-小类
    @NotNull(message = "分类级别必填!")
    public Long classifyLevel;

    //父类id
    @NotNull(message = "父类id必填!")
    public int parentClassifyId;

    @TableField(exist = false)
    public String parentName;

    //分类名称
    @NotBlank(message="分类名称不能为空")
    public String classifyValue;

    //分类编码
    @NotBlank(message="分类编码不能为空")
    public String code;

    //创建人ID
    public int createUserId;

    //创建人名称
    @TableField(exist = false)
    public String createUserName;

    //创建时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    public Date createTime;

    //更新人ID
    public int updateUserId;

    //更新人名称
    @TableField(exist = false)
    public String updateUserName;

    //更新时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    public Date updateTime;

    //删除标记(0-未删除  1-删除)
    @TableLogic
    public int deleted;

    //ztree属性
    @TableField(exist=false)
    private Boolean open;

    @TableField(exist=false)
    private List<?> list;

}
